
import http from '@/utils/request'

export function login( data ) {
  // return http.request( {
  //   method : 'post',
  //   url : '/v1/user/login',
  //   data
  // } )


  return new Promise( resolve => {
    const result = {
      code : 200,
      message : "success",
      data : {
        id : 9527,
        nickName : '编号9527',
        token : 'token9527'
      }
    }
    resolve( result )
  } )
}

// 刷新图形验证码
export function getCode( data ) {
  return http.request( {
    method : 'get',
    url : '/v1/user/captcha',
    data
  } )
}

// 根据token 获取用户信息
export function getUserInfo( data ) {
  return http.request( {
    method : 'get',
    url : '/v1/user/normalInfo',
    data
  } )
}

// 退出登录
export function logout( data ) {
  return http.request( {
    method : 'post',
    url : '/v1/user/loginOut',
    data
  } )
}
